<?php
if ($_SERVER['REMOTE_ADDR'] == '86.182.174.205' || $_SERVER['REMOTE_ADDR'] == '173.212.202.170' || $_SERVER['REMOTE_ADDR'] == '113.161.85.105' || $_SERVER['REMOTE_ADDR']=='127.0.0.1')
{
	// Enable debug
	define('PHPFOX_DEBUG', 1);
	 
	// Debug level
	define('PHPFOX_DEBUG_LEVEL', 3);
	 
	// Force templates re-cache on each page refresh
	define('PHPFOX_NO_TEMPLATE_CACHE', true);
	 
	// Force browsers to re-cache static files on each page refresh
	define('PHPFOX_NO_CSS_CACHE', true);

	// Override default email
	define('PHPFOX_DEFAULT_OUT_EMAIL', 'your_email@email.com');
	 
	// Skip sending out of emails
	define('PHPFOX_SKIP_MAIL', true);
	 
	// Use live templates and not those from the database
	define('PHPFOX_LIVE_TEMPLATES', true);
	 
	// Add user_name in the title of each page. Great for when working with many browsers open
	define('PHPFOX_ADD_USER_TITLE', true);
	 
	// Cache emails to flat files
	//define('PHPFOX_CACHE_MAIL', true);
	 
	// Log error messages to XML flat file within the cache folder
	define('PHPFOX_LOG_ERROR', true);
	 
	// Skip the storing of cache files in the DB
	define('PHPFOX_CACHE_SKIP_DB_STORE', true);
} 
//---------------------------------------------------------------------------------------//
function echoDebug($object,$is_exit = false)
{
    if(is_array($object) || is_object($object))
    {
        echo "<pre>".print_r($object,true)."</pre>";
    }
    else
    {
        var_dump($object);
        
    }
    if($is_exit == true)
    {
        die('<br/>--------------------------------------<br/>exit by debug.');
    }
}
//---------------------------------------------------------------------------------------//
?>
<?php
  /**
 * Logging class:
 * - contains lopen and lwrite methods
 * - lwrite will write message to the log file
 * - first call of the lwrite will open log file implicitly
 * - message is written with the following format: hh:mm:ss (script name) message
 */
class Logging{
    // define log file
    private $log_file = '';
    // define file pointer
    private $fp = null;
    // write message to the log file
    public function __construct()
    {
        $this->log_file = dirname(_FILE__).'/logfile.txt'; 
    }
    public function lwrite($message){
        // if file pointer doesn't exist, then open log file
        if (!$this->fp) $this->lopen();
        // define script name
        $script_name = pathinfo($_SERVER['PHP_SELF'], PATHINFO_FILENAME);
        // define current time
        $time = date('H:i:s');
        // write current time, script name and message to the log file
        fwrite($this->fp, "$time ($script_name) $message\n");
    }
    // open log file
    private function lopen(){
        // define log file path and name
        $lfile = $this->log_file;
        // define the current date (it will be appended to the log file name)
        $today = date('Y-m-d');
        // open log file for writing only; place the file pointer at the end of the file
        // if the file does not exist, attempt to create it
        $this->fp = fopen($lfile . '_' . $today, 'a') or exit("Can't open $lfile!");
    }
}

?>
